package com.ruoyi.system.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ruoyi.system.domain.TmcCommunityActivity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TmcActivityUserMapper;
import com.ruoyi.system.domain.TmcActivityUser;
import com.ruoyi.system.service.ITmcActivityUserService;

/**
 * 社区活动中间
 * Service业务层处理
 *
 * @author ruoyi
 * @date 2021-04-21
 */
@Service
public class TmcActivityUserServiceImpl implements ITmcActivityUserService {
    @Autowired
    private TmcActivityUserMapper tmcActivityUserMapper;

    /**
     * 查询社区活动中间
     *
     * @param id 社区活动中间
     *           ID
     * @return 社区活动中间
     */
    @Override
    public TmcActivityUser selectTmcActivityUserById(Long id) {
        return tmcActivityUserMapper.selectTmcActivityUserById(id);
    }

    /**
     * 查询社区活动中间
     * 列表
     *
     * @param tmcActivityUser 社区活动中间
     * @return 社区活动中间
     */
    @Override
    public List<TmcActivityUser> selectTmcActivityUserList(TmcActivityUser tmcActivityUser) {
        return tmcActivityUserMapper.selectTmcActivityUserList(tmcActivityUser);
    }

    /**
     * 新增社区活动中间
     *
     * @param tmcActivityUser 社区活动中间
     * @return 结果
     */
    @Override
    public int insertTmcActivityUser(TmcActivityUser tmcActivityUser) {
        return tmcActivityUserMapper.insertTmcActivityUser(tmcActivityUser);
    }

    /**
     * 修改社区活动中间
     *
     * @param tmcActivityUser 社区活动中间
     * @return 结果
     */
    @Override
    public int updateTmcActivityUser(TmcActivityUser tmcActivityUser) {
        return tmcActivityUserMapper.updateTmcActivityUser(tmcActivityUser);
    }

    /**
     * 批量删除社区活动中间
     *
     * @param ids 需要删除的社区活动中间
     *            ID
     * @return 结果
     */
    @Override
    public int deleteTmcActivityUserByIds(Long[] ids) {
        return tmcActivityUserMapper.deleteTmcActivityUserByIds(ids);
    }

    /**
     * 删除社区活动中间
     * 信息
     *
     * @param id 社区活动中间
     *           ID
     * @return 结果
     */
    @Override
    public int deleteTmcActivityUserById(Long id) {
        return tmcActivityUserMapper.deleteTmcActivityUserById(id);
    }

    //    参加的收费活动
    @Override
    public List<TmcCommunityActivity> queryListByuserId(Long id) {
        return tmcActivityUserMapper.queryListByuserId(id);
    }

    //    活动相关账单
    @Override
    public List<TmcActivityUser> queryListById(Long activityId, Long publicuserId) {
        Map map = new HashMap();
        map.put("activityId", activityId);
        map.put("publicuserId", publicuserId);
        return tmcActivityUserMapper.queryListById(map);
    }


}
